package com.qf.hello.spring.service.impl;

import com.qf.hello.spring.dao.UserDao;
import com.qf.hello.spring.dao.impl.UserDaoImpl;
import com.qf.hello.spring.service.UserService;

public class UserServiceImpl implements UserService {
//    private UserDao userDao=new UserDaoImpl();
    private UserDao userDao;

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public int deleteById(Integer id) {
        System.out.println("业务层删除用户");
        return userDao.deleteById(id);
    }

    // 自定义当前对象的初始化方法
    public void initOf(){
        System.out.println("自定义的对象初始化方法");
    }

    // 自定义当前对象的销毁方法
    public void destroyQf(){
        System.out.println("自定义的对象销毁方法");
    }
}
